package bavaria.hightech.testit.pruefungen.ws09;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class CFBoard {
	
	public static final int COLUMNS = 7;
	public static final int ROWS = 6;
	private List<List<CFPiece>> columnList;
	
	public CFBoard() {
		columnList = new ArrayList<List<CFPiece>>();
		for (int i = 1; i < COLUMNS; i++) {
			columnList.add(new ArrayList<CFPiece>());
		}

	}
	
	public int dropPiece(int column, CFPiece piece){
		//TODO: impl
		return 0;
	}
	
	public String toString(){
		//TODO: impl
		return null;
	}
	
	public CFPiece getPiece(GridPoint point){
		
		if(columnList.get(point.col).contains(columnList.get(point.col).get(point.row))){
		CFPiece p = columnList.get(point.col).get(point.row);
		return p;
		}
		return null;
	}
	
	public int countEqualPiecesInOneDirection(GridPoint start, GridPoint delta){
		int count = 0;
		for (List<CFPiece> arrayListInCol : columnList) {
			for (CFPiece piece : arrayListInCol) {
				
			}
		}
		
		return count;
	}

}
